using System.Data;
using MySqlConnector;

namespace Front._1127.M;

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
}

private void BookForm1_Load(object sender, EventArgs e)
{
    GetALLBook();
}

private void GetALLBook()
{
    using var connection = new MySqlConnection("server=localhost;port=3306;user id=root;password=123456;database=1127;charset=utf8mb4;");
    connection.Open();
    string sql = "SELECT * FROM `book`;";
    MySqlCommand cmd = new MySqlCommand(sql, connection);
    DataSet dataset = new DataSet();
    MySqlDataAdapter adapter = new MySqlDataAdapter();
    adapter.SelectCommand = cmd;
}